<?php

header('Content-type: text/html; charset=utf-8');

include_once($_SERVER["DOCUMENT_ROOT"]."/public/function.php");
$config = include_once($_SERVER["DOCUMENT_ROOT"]."/public/config.php");

$_POST['pic'] =up('pic');


$res = add($config,'tupian');

if($res){
    echo '<script>alert("添加成功！");window.location.href="add.php"</script>';
}else{
    echo $sql; die;
    echo '<script>alert("添加失败！");window.location.href="index.php"</script>';
    
}
?>